<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>后台管理系统</title>
    <link href="{$skin}/images/style.css" rel="Stylesheet" type="text/css" />
    <link href="Styles/menu.css" rel="Stylesheet" type="text/css" />
    <script src='{$skin}js/jquery.min.js'></script>
    <script language="javascript" type="text/javascript">
        function SetWinHeight(obj)
        {
            var win=obj;
            if (document.getElementByIdx_x)
            {
                if (win && !window.opera)
                {
                    if (win.contentDocument && win.contentDocument.body.offsetHeight)
                        win.height = win.contentDocument.body.offsetHeight;
                    else if(win.Document && win.Document.body.scrollHeight)
                        win.height = win.Document.body.scrollHeight;
                }
            }
        }
        function logout() {
            if (confirm("您确定要退出控制面板吗？"))
                top.location = "?a=out";
            return false;
        }
        function qh(i){
            $(".left_menu").hide();
            $(".cate"+i).show();
            //$(".cate"+i).show().siblings().hide();
        }
        $(document).ready(function(){
            //qh(11);
            qh(20);
        });
    </script>
</head>
<body>
<form id="form1" runat="server">
    <div id="framecontentLeft">
        <div style="height:98px;"></div>
        <div class="left">
            <div id="container">
                <?php
                $url = 'select columnid,columnname,columntop from __actioncolumn where columnshow=1 and columntop>0 order by columnrank asc,columnid desc';
                $r = db::_query($url);
                $i = 1;
                while ($o = db::_object($r)) {
                    echo '<div class="left_menu cate'.$o->columntop.'">';
                    echo '<h1 class="type"><a class="href="javascript:void(0)">' . $o->columnname . '</a></h1>';
                    //$style = $i > 2 ? 'style="display:none"' : '';
                    echo '<div class="content" ' . $style . '>';
                    $sql = 'select * from __action a where a.viewmode=1 and a.columnid=' . $o->columnid . ' group by a.actionid order by a.rank asc,a.actionid asc';
                    $zr = db::_query($sql);
                    while ($zo = db::_object($zr)) {
                        if($rights!='All'){
                            if(!in_array($zo->unique,$rights))continue;
                        }
                        if(strpos($zo->unique,'@')){
                            $u=explode('@',$zo->unique);
                            $url='?c='.$u[0].'&a='.$u[1];
                        }else{
                            $url='?c='.$zo->unique;
                        }
                        echo '<a href="' . $url . '" target="content">' . $zo->actionname . '</a>';
                    }
                    echo '</div>';
                    echo '</div>';
                    $i++;
                }
                ?>
                <div class="left_menu"><h1><a class="icon-off" href="javascript:void(0)" onClick="logout();">退出系统</a></h1></div>
            </div>
        </div>
    </div>
    <div id="framecontentTop">
        <?php
        $ha=$_SERVER["HTTP_USER_AGENT"];
        if (strpos($ha, "MSIE 7.0") || strpos($ha, "MSIE 6.0") || strpos($ha, "Firefox/3") || strpos($ha, "Firefox/2")){
            echo '<div style="height:30px;line-height: 30px;font-size:16px;;background: #F17B6B;text-align: center;color:#fff;">请使用 火狐,Google,遨游等最新版浏览器.后台在低版本 IE浏览器下会出错</div>';
        }
        ?>
        <div class="header">
            <h1><a href="javascript:window.location.reload()" target="_top"></a></h1>

            <div class="khelp"><a target="_blank" class="helpa" href="http://www.ibuyu.cn/help">帮助</a>
                <a class="helpabout" href="http://www.ibuyu.cn/about">about</a></div>
            <ul class="kmenul">
                <li class="index"><a href="javascript:window.location.reload()" target="_blank">首页</a></li>
                <li><a href="../index.php" target="_blank">前台首页</a></li>
                <?php
                $sql = 'select columnid,columnname from __actioncolumn where columnshow=1 and columntop=0 order by columnrank asc';
                $res = db::_query($sql);
                while ($r = db::_object($res)) {
                    echo ' <li><span onclick="qh(' . $r->columnid . ')">' . $r->columnname . '</span></li>';
                }
                ?>
            </ul>
            <div class="clear"></div>

        </div>
        <div class="clear"></div>
        <div class="pinfo">
            欢迎您,管理员 <?= $info['mastername'] ?>  <a href="?c=master&a=info&id=<?php echo $info['masterid']?>">账号管理</a>  <a href="javascript:;" target="_self" onClick="logout();">安全退出</a></div>
    </div>
    <div id="maincontent">
        <iframe id="content" name="content" onload="Javascript:SetWinHeight(this)" frameborder="0"
                scrolling="yes" height="100%" width="100%" src="?a=right"></iframe>
    </div>
</form>
</body>
</html>